
package com.service.impl;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.MachineDao;
import com.entity.MachineEntity;
import com.service.MachineService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;



@Service
public class MachineServiceImpl extends ServiceImpl<MachineDao, MachineEntity> implements MachineService {


    @Override
    public Page<MachineEntity> allMachine(Integer pageNum, Integer pageSize, String value) {
        EntityWrapper<MachineEntity> wrapper = new EntityWrapper<>();
        if(StringUtils.isNotBlank(value)){
            wrapper.like("name", value);
        }
        return this.selectPage(new Page<>(pageNum,pageSize),wrapper);
    }
}
